-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Shortcode Orders When Using WooPay Direct Checkout #8802
Conversation
Previously, when checking out using the shortcode checkout, if a draft order existed for a given session, that draft order would be used to complete the checkout. However, the draft order was incomplete. Now, the draft order is picked up and updated before going through the entire checkout process.
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.25 MB ℹ️ View Unchanged
|
@reykjalin, I made a minor change to fully address the following issue: The change ensures that an order is considered to be in one single state (either "draft" or "pending payment") in the current session. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great and all the tests pass 💯
Had one small nitpick, but otherwise this is looking fiiiine 👌
Co-authored-by: Kristófer Reykjalín <[email protected]>
Fixes #8775
Fixes #8628
Changes proposed in this Pull Request
The changes in this PR ensure that when we reuse a draft order, it is updated with all necessary details (address, currency, etc.).
Previously, when a draft order was created through the Direct Checkout flow, it was re-used to avoid a "stock: 1" bug (see #7256 for details). However, when reusing the draft order, the order did not include all the necessary information.
Now, when a draft order is created through the Direct Checkout flow, it will still be re-used to avoid the "stock: 1" bug but the order will also be marked as "pending" so that it gets updated (as it normally would) during checkout.
Testing instructions
Confirm issue: Shortcode orders are missing address
develop
branch.Confirm solution: Shortcode orders are not missing address
fix/8775-direct-checkout-shortcode-orders
.Confirm issue: Currency switcher doesn't work with shortcode checkout
develop
branch.Confirm solution: Currency switcher works with shortcode checkout
fix/8775-direct-checkout-shortcode-orders
.Regression Test: Ensure Purchasing a Product With 1 Stock Does Not Fail (see #7256 for details)
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge